package com.ruoyi.InboundManagement.service.impl;

import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.InboundManagement.mapper.ScrapInboundMapper;
import com.ruoyi.InboundManagement.domain.ScrapInbound;
import com.ruoyi.InboundManagement.service.IScrapInboundService;

/**
 * 报废入库管理Service业务层处理
 * 
 * @author admin
 * @date 2024-07-02
 */
@Service
public class ScrapInboundServiceImpl implements IScrapInboundService 
{
    @Autowired
    private ScrapInboundMapper scrapInboundMapper;

    /**
     * 查询报废入库管理
     * 
     * @param scrapId 报废入库管理主键
     * @return 报废入库管理
     */
    @Override
    public ScrapInbound selectScrapInboundByScrapId(Long scrapId)
    {
        return scrapInboundMapper.selectScrapInboundByScrapId(scrapId);
    }

    /**
     * 查询报废入库管理列表
     * 
     * @param scrapInbound 报废入库管理
     * @return 报废入库管理
     */
    @Override
    public List<ScrapInbound> selectScrapInboundList(ScrapInbound scrapInbound)
    {
        return scrapInboundMapper.selectScrapInboundList(scrapInbound);
    }

    /**
     * 新增报废入库管理
     * 
     * @param scrapInbound 报废入库管理
     * @return 结果
     */
    @Override
    public int insertScrapInbound(ScrapInbound scrapInbound)
    {
        scrapInbound.setCreateTime(new Date());
        return scrapInboundMapper.insertScrapInbound(scrapInbound);
    }

    /**
     * 修改报废入库管理
     * 
     * @param scrapInbound 报废入库管理
     * @return 结果
     */
    @Override
    public int updateScrapInbound(ScrapInbound scrapInbound)
    {
        return scrapInboundMapper.updateScrapInbound(scrapInbound);
    }

    /**
     * 批量删除报废入库管理
     * 
     * @param scrapIds 需要删除的报废入库管理主键
     * @return 结果
     */
    @Override
    public int deleteScrapInboundByScrapIds(Long[] scrapIds)
    {
        return scrapInboundMapper.deleteScrapInboundByScrapIds(scrapIds);
    }

    /**
     * 删除报废入库管理信息
     * 
     * @param scrapId 报废入库管理主键
     * @return 结果
     */
    @Override
    public int deleteScrapInboundByScrapId(Long scrapId)
    {
        return scrapInboundMapper.deleteScrapInboundByScrapId(scrapId);
    }
}
